﻿@model ScmSpecialEquipmentViewModel
@{
    ViewBag.Title = "特种设备台账-列表";
    Layout = null;
}

@using (Html.BeginForm("SplitPage", "ScmSpecialEquipment", null, FormMethod.Post, new { id = "pagerForm", onsubmit = "return divSearch(this, 'tzgl_tzsb_list');" }))
{
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
    <input type="hidden" name="input_section" value="@(ViewBag.Section)" />
    <ul class="searchBar">
        <li><span>设备名称：</span>
            <input type="text" name="iput_equipment" value="@(ViewBag.iput_equipment)" />
        </li>
        <li><span>设备型号：</span>
            <input type="text" name="iput_model" value="@(ViewBag.iput_model)" />
        </li>
        <li>
            <button type="submit" class="btn btn-success btn-xs">
                搜索</button>
        </li>
    </ul>
   
}
<div class="panelBar" style="border-top: none;">
    <ul class="toolBar">
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialEquipment.Create", "tzgl_tzsb_add",
                    Url.Action("SpecialEquipmentAdd", "ScmSpecialEquipment", new { Section = ViewBag.Section }),
                    "添加",
                    new Dictionary<string, object>
                    {
                        {"class","add"},{"rel","tzgl_tzsb_add"} ,{"mask","true"},{"target","dialog"},{"width","400"},{"height","400"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialEquipment.Delete", "tzgl_tzsb_delete",
                                      Url.Action("SpecialEquipmentDelete", "ScmSpecialEquipment", new { id = "{ids}" }),
                    "删除",
                    new Dictionary<string, object>
                    {
                        {"class","delete"},{"title","确定要删除这些记录吗?"} ,{"target","ajaxTodo"},{"callback","function(){$('#pagerForm', navTab.getCurrentPanel()).submit();}"}
                    })

        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialEquipment.Edit", "tzgl_tzsb_edit",
                    Url.Action("SpecialEquipmentEdit", "ScmSpecialEquipment", new { id = "{ids}" }),
                    "修改",
                    new Dictionary<string, object>
                    {
                        {"class","edit"},{"rel","tzgl_tzsb_edit"} ,{"mask","true"},{"target","dialog"},{"width","400"},{"height","400"},{"warn","请选择一条信息!"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialEquipment.Detail", "tzgl_tzsb_detail",
                    Url.Action("SpecialEquipmentDetail", "ScmSpecialEquipment", new { id = "{ids}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","tzgl_tzsb_detail"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","320"},{"warn","请选择一条信息!"}
                    })
        </li>
        <li class="line">line</li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialEquipment.Download", "tzgl_tzsb_download",
                    "../../Areas/SafetyConstruction/Upload/特种设备台账.xls",
                    "模板",
                    new Dictionary<string, object>
                    {
                        {"class","download"},{"targettype","navTab"} ,{"title","模板下载"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialEquipment.Input", "tzgl_tzsb_input",
                    Url.Action("Index", "Import", new { url = "/ScmSpecialEquipment/ImportExcelFile", Section = ViewBag.Section }),
                    "导入",
                    new Dictionary<string, object>
                    {
                        {"class","input"},{"rel","tzgl_tzsb_input"} ,{"lookupgroup","attachment"},{"width","320"},{"height","320"},{"title","导入EXCEL"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialEquipment.Export", "tzgl_tzsb_export",
                    Url.Action("Excel", "ScmSpecialEquipment", new { Section = ViewBag.Section, danwei = ViewBag.danwei }),
                    "导出",
                    new Dictionary<string, object>
                    {
                        {"class","export"},{"targettype","navTab"} ,{"title","导出EXCEL"}
                    })
        </li>
    </ul>
</div>
<div class="panelBar" style="border-top: none;">
    <ul class="toolBar">
        <li class="nobg"><b>标段：@ViewBag.Section</b></li>
        <li class="nobg" style="float: right;"><b>施工单位：@ViewBag.danwei</b></li>
    </ul>
</div>

<table class="list" width="900">
    <thead>
        <tr align="center">
            <th rowspan="2" width="35">序号
            </th>
            <th rowspan="2" width="120">设备名称
            </th>
            <th rowspan="2" width="110">型号
            </th>
            <th rowspan="2" width="110">进场日期
            </th>
            <th rowspan="2" width="150">使用点
            </th>
            <th colspan="3">设备报检情况
            </th>
            <th rowspan="2" width="110">退场日期
            </th>
        </tr>
        <tr align="center">
            <th width="110">检验时间
            </th>
            <th width="110">检验单位
            </th>
            <th width="110">检验结果
            </th>
        </tr>
    </thead>
</table>
<div layouth="176">
    <table class="list" width="900" nowraptd="false" rel="tzgl_tzsb_list">
        <tbody>
            @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
            @foreach (var item in Model.TheSpecialEquipmentList)
            {
                num += 1;
                <tr target="ids" rel="@item.Se_ID" align="center">
                    <td width="35">
                        @num
                    </td>
                    <td width="120">
                        <a style="color:#000;" href="@Url.Action("SpecialEquipmentDetail", "ScmSpecialEquipment", new { id = item.Se_ID })" rel="tzgl_tzsb_detail" mask="true" target="dialog" width="480" height="320">@item.Se_Equipment</a>
                    </td>
                    <td width="110">@item.Se_Model
                    </td>
                    <td width="110">@(item.Se_EnterDate == null ? "" : Convert.ToDateTime(item.Se_EnterDate).ToString("yyyy-MM-dd"))
                    </td>
                    <td width="150">@item.Se_UsePoint
                    </td>
                    <td width="110">@(item.Se_CheckTime == null ? "" : Convert.ToDateTime(item.Se_CheckTime).ToString("yyyy-MM-dd"))
                    </td>
                    <td width="110">@item.Se_CheckUnit
                    </td>
                    <td width="110">@item.Se_CheckResult
                    </td>
                    <td width="110">@(item.Se_ExitDate == null ? "" : Convert.ToDateTime(item.Se_ExitDate).ToString("yyyy-MM-dd"))
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
<div class="panelBar" style="border-bottom: none;">
    <div class="pages"  style="float: right">
        <span>显示</span>
        <select class="comsplitpage" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value}, 'tzgl_tzsb_list')">
            <option value="10" @(ViewBag.numPerPage == 10 ? "selected='selected'" : "")>10</option>
            <option value="20" @(ViewBag.numPerPage == 20 ? "selected='selected'" : "")>20</option>
            <option value="50" @(ViewBag.numPerPage == 50 ? "selected='selected'" : "")>50</option>
        </select>
        <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
    </div>
    <div class="pagination" style="margin:0px;float:left; margin-left:35%" rel="tzgl_tzsb_list" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)">
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        //$("div#tzgl_tzsb_list select[name='numPerPage']").val(@ViewBag.numPerPage);
        var w = $("#tzgl_tzsb_list").width();
        $("div#tzgl_tzsb_list table").attr("width", w);
    });
</script>
